package com.itheima.fanfa;

import java.util.ArrayList;
import java.util.Collections;
import java.util.function.Predicate;

/**
 * @author zhangbaiyan
 * @date 2024-09-17 15:30
 * @description:
 * @version:
 */
public class test {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"张无忌","周紫若","赵敏","张强","张三分");
//        StringOperation so = new StringOperation();
        list.stream().filter(new test()::stringJudge).forEach(System.out::println);
        
//        list.stream().filter( s-> s.startsWith("张")&& s.length()==3).forEach(System.out::println);
    }

    public boolean stringJudge(String s) {
        return s.startsWith("张")&&s.length() == 3;
    }
    
}
